package cn.kxm.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


	
import cn.kxm.dao.PurchaseOrderBillDao;
import cn.kxm.pojo.PurchaseOrderBill;
import cn.kxm.service.PurchaseOrderBillService;
@Service
public class PurchaseOrderBillServiceImpl implements PurchaseOrderBillService{

	@Autowired
	private PurchaseOrderBillDao purchaseOrderBillDao;
	
	@Override
	public List<Map<String, Object>> getPurchaseOrderBillByCompanyName(
			String CompanyName, Integer page, Integer size, Date fromDate,
			Date endDate, String code) {
		Integer currPage=(page-1)*size;
		return purchaseOrderBillDao.getPurchaseOrderBillByCompanyName(CompanyName, currPage, size, fromDate, endDate, code);
	}

	@Override
	public int getPurchaseOrderBillByCompanyNameCount(String CompanyName,
			Date fromDate, Date endDate, String code) {
		return purchaseOrderBillDao.getPurchaseOrderBillByCompanyNameCount(CompanyName, fromDate, endDate, code);
	}
	@Override
	public List<PurchaseOrderBill> getAll(PurchaseOrderBill purchaseOrderBill,Integer currentPageNo,
			Integer pageSize) {
		
		return purchaseOrderBillDao.getAll(purchaseOrderBill,(currentPageNo-1)*pageSize,pageSize);
	}
	@Override
	public int getPurchaseOrderBillCount(PurchaseOrderBill purchaseOrderBill) {
		return purchaseOrderBillDao.getPurchaseOrderBillCount(purchaseOrderBill);
	}
	@Override
	public PurchaseOrderBill getByCode(String code) {
		return purchaseOrderBillDao.getByCode(code);
	}
	@Override
	public int addPurchaseOrderBillCount(PurchaseOrderBill purchaseOrderBill) {
		int a=purchaseOrderBillDao.addPurchaseOrderBillCount(purchaseOrderBill);
		return a;
	}
	@Override
	public int modifyPurchaseOrderBill(PurchaseOrderBill purchaseOrderBill) {
		return purchaseOrderBillDao.modifyPurchaseOrderBill(purchaseOrderBill);
	}
	@Override
	public int delPurchaseOrderBill(String code) {
		return purchaseOrderBillDao.delPurchaseOrderBill(code);
	}

	@Override
	public int modifyPurchaseOrderBillByCode_checkStatus(String code,Integer checkStatus) {
		return purchaseOrderBillDao.modifyPurchaseOrderBillByCode_checkStatus(code,checkStatus);
	}
	
		@Override
	public int updateOrderInstroageStatus(List<String> codes,Integer statusNum) {
		return purchaseOrderBillDao.updateOrderInstroageStatus(codes,statusNum);
	}

}
